package com.clazzwork.movie;

/**
 * @author nmm
 * @date 2024-03-2024/3/21
 * @deriction njm......
 */
public class MovieThread extends Thread {

    private static int totalticket=1000;

    @Override
    public void run() {
        while (true){
            synchronized (MovieThread.class){
                if (totalticket>0){
                    System.out.println(Thread.currentThread().getName() + "出售了第 " + totalticket-- + " 张票");
                }else {
                    break;
                }
            }
        }
    }



}
